package pe.intix.drawback.model

import javax.persistence.*;

import org.openxava.annotations.*;

/**
 * @author Jeromy Altuna
 * 
 */
@Entity
@Views([
	@View(extendsView = "super.DEFAULT", members = """;
			cliente;
			Montos [# 
				tipoMoneda, valorVenta, importeTotal
			];
			detalleComprobantePago;
			glosa"""
	),
	@View(name = "Simple", extendsView = "super.SerieNumeroFecha", 
		  members = "; cliente"
	)
])
@Tab(properties="serie, numero, fecha, cliente.razonSocial, glosa, hayImagen")
@DiscriminatorValue("2")
class ComprobanteVenta extends ComprobantePago {

	@Column(name = "tipo_cambio", precision = 14, scale = 6)
	BigDecimal tipoCambio

	@Required @ReferenceView("ForSale")
	@JoinColumn(name = "id_proveedor", referencedColumnName="id_proveedor")
	@ManyToOne(fetch = FetchType.LAZY, optional = false)
	Proveedor cliente	
}
